import request from '@/utils/request'

// 查询动作规则列表
export function listRule(query) {
  return request({
    url: '/action/rule/list',
    method: 'get',
    params: query
  })
}

// 查询动作规则详细
export function getRule(id) {
  return request({
    url: '/action/rule/' + id,
    method: 'get'
  })
}

// 新增动作规则
export function addRule(data) {
  return request({
    url: '/action/rule',
    method: 'post',
    data: data
  })
}

// 修改动作规则
export function updateRule(data) {
  return request({
    url: '/action/rule',
    method: 'put',
    data: data
  })
}

// 删除动作规则
export function delRule(id) {
  return request({
    url: '/action/rule/' + id,
    method: 'delete'
  })
}
// 修改动作优先级
export function updateRuleState(ids) {
  return request({
    url: '/action/rule/updateRuleState?ruleIds=' + ids,
    method: 'get'
  })
}
